UserData = {}

UserData.init = function()
  local path=CCFileUtils:sharedFileUtils():fullPathFromRelativePath("config.json")
  local txt=CCString:createWithContentsOfFile(path):getCString()
  UserData.config = cjson.decode(txt)
  
  path=CCFileUtils:sharedFileUtils():fullPathFromRelativePath("quest.json")
  txt=CCString:createWithContentsOfFile(path):getCString()
  UserData.quests = cjson.decode(txt)

  path=CCFileUtils:sharedFileUtils():fullPathFromRelativePath("userinfo")
  txt=CCString:createWithContentsOfFile(path):getCString()
  UserData.userinfo = cjson.decode(txt)

  path=CCFileUtils:sharedFileUtils():fullPathFromRelativePath("login.json")
  txt=CCString:createWithContentsOfFile(path):getCString()
  UserData.login = cjson.decode(txt)
end

--[[
UserData.getAllCheckPoints = function()
  return Array:create(UserData.config.models.Checkpoint)
end

UserData.getCheckPointsByStronghold = function(id)
  return Array:create(UserData.config.models.Stronghold[id+1].checkpoints)
end]]
